package nl.scalasim

import scala.actors.{Future, Actor}
import nl.scalasim.controlactors.{Guildmaster, Historian, Choreographer, Governor}

/**
 * Holds references to all existing Control Actors, so the simulation
 * actors know who to talk to. 
 *
 * @author Yigal Duppen
 * @since Nov 2, 2010
 */
case class AddressBook(governor: Governor,
                       choreographer: Choreographer,
                       historian: Historian,
                       guildmaster: Guildmaster
        )
{
  
  val all: Set[Actor] = Set(governor, choreographer, historian, guildmaster)

  def broadcast(m: Message): Set[Future[Any]] = all map { _ !! m }

}